package com.atguigu.lease.web.admin.mapper;

import com.atguigu.lease.model.entity.AttrValue;
import com.atguigu.lease.web.admin.vo.attr.AttrValueVo;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
* @author liubo
* @description 针对表【attr_value(房间基本属性值表)】的数据库操作Mapper
* @createDate 2023-07-24 15:48:00
* @Entity com.atguigu.lease.model.AttrValue
*/
public interface AttrValueMapper extends BaseMapper<AttrValue> {

    @Select("select aa.id id, name, attrKeyId, attrKeyName from room_attr_value rav left join" +
            "    (select av.id,av.name name,av.attr_key_id attrKeyId,ak.name attrKeyName from attr_value av left join attr_key ak on ak.id = av.attr_key_id\n" +
            "        and ak.is_deleted=0 where av.is_deleted=0) aa on rav.attr_value_id=aa.id where rav.is_deleted=0 and rav.room_id=#{id}")
    List<AttrValueVo> queryVo(Long id);
}




